package com.navigationtest.tool;

import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;

import androidx.databinding.BindingAdapter;

/**
 * User: psn
 * Date: 2021/7/21
 * 标题栏适配
 */
public class TitleBindingAdapter {
    @BindingAdapter(value = "setOnTitleBarListener",requireAll = false)
    public static void  setOnTitleBarListener(TitleBar view, OnTitleBarListener onTitleBarListener){
        view.setOnTitleBarListener(onTitleBarListener);
    }

    @BindingAdapter(value = "setTitle",requireAll = false)
    public static void  setTitle(TitleBar view, String string){
        view.setTitle(string);
    }

    @BindingAdapter(value = "setRightTitle",requireAll = false)
    public static void  setRightTitle(TitleBar view, String string){
        view.setRightTitle(string);
    }

    @BindingAdapter(value = "hideLiftIcon",requireAll = false)
    public static void  hideLiftIcon(TitleBar view ,boolean hide){
        if (hide ){
            view.setLeftIcon(null) ;
        }

    }
}
